﻿
Public Class fixed_list(Of T)
    Inherits list(Of T)

    Private ReadOnly length As Int64 = 0

    Public Shadows Sub insert(ByVal v As T)
        push_back(v)
    End Sub

    Public Shadows Sub push_back(ByVal v As T)
        MyBase.push_back(v)
        If size() > length Then
            pop_front()
        End If
    End Sub

    Public Shadows Sub push_front(ByVal v As T)
        MyBase.push_front(v)
        If size() > length Then
            pop_back()
        End If
    End Sub

    Public Sub New(ByVal count As Int64)
        length = count
    End Sub
End Class
